package xiaopiya.robot.handler.help;

import xiaopiya.robot.handler.AbstractMessageHandler;

/**
 * 帮助请求处理
 * 
 * @author Ray (ayufox@gmail.com)
 * @version 0.1
 */
public class HelpMessageHandler extends AbstractMessageHandler
{
	private HelpConfig helpConfig;

	public void setHelpConfig(HelpConfig helpConfig)
	{
		this.helpConfig = helpConfig;
	}

	/* (non-Javadoc)
	 * @see xiaopiya.robot.handler.AbstractMessageHandler#handle(java.lang.String, java.lang.String)
	 */
	protected String handle(String from, String params)
	{
		params = params.trim();
		String[] array = params.split(" ");
		return this.helpConfig.getText(array[0]);
	}
}